﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;

namespace MvcEngine.Core.Extensions
{
    public static class NameValueCollectionExtensions
    {
        public static bool IsTrue(this NameValueCollection collection, string key)
        {
            bool isTrue;
            return collection != null
                && collection.GetValues(key) != null
                && bool.TryParse(collection.GetValues(key)[0], out isTrue)
                && isTrue;
        }
    }
}
